/*
	Andrew Q. Philips
	7/3/19
	replication files for "Just in time: Political policy cycles of land reform" Forthcoming at Politics
	
	--Survey analysis portion
	
*/

use "survey_INES_small.dta", clear

* ------------------------------------------------------------------------
* FIGURE 2 A, B
preserve
catplot propertylimit,  percent recast(bar) ytitle("Percentage of Respondents")  var1opts(gap(*0.1) sort(1) descending axis(noline)) b1title("") 
graph export "propertyceiling.pdf", as(pdf) replace

keep if surv_yr == 1971
lab define lg -1 "No" 1 "Yes" 0 "Maybe/Don't Know"
lab val landgrab lg
catplot landgrab, percent recast(bar) ytitle("Percentage of Respondents") var1opts(gap(*0.1) sort(1) descending axis(noline)) b1title("")
graph export "landgrabs.pdf", as(pdf) replace
restore
* ------------------------------------------------------------------------
	
eststo clear
qui logit land_inequality c.landref_67_71##i.sy1971 dalit backwards brahmin male hindu muslim farmlabor_cultivator education rural poli_interest young, cluster(state)
gen mod1 = e(sample)
qui logit supp_landgrab c.landref_71_85##i.sy1985 dalit backwards brahmin male hindu muslim farmlabor_cultivator education rural poli_interest young, cluster(state)
gen mod2 = e(sample)

*	---------------------------------------------------------------------
/*		DID APPROACH
---------------------------------------------	*/  
eststo clear

* Land/Inequality as MIP:
eststo: logit land_inequality sy1971 i.anyreform6771 i.state if mod1==1
margins, dydx(sy1971) at(anyreform6771=(0)) atmeans
margins , dydx(anyreform6771) at(sy1971=(1)) atmeans

eststo: logit land_inequality sy1971 landref_67_71 i.state if mod1 == 1
margins, dydx(sy1971) at(landref_67_71=(0)) atmeans
margins , dydx(landref_67_71) at(sy1971=(1)) atmeans

eststo: logit land_inequality sy1971 anyreform6771 dalit backwards brahmin male hindu muslim farmlabor_cultivator education rural poli_interest young i.state if mod1==1
eststo: logit land_inequality sy1971 landref_67_71 dalit backwards brahmin male hindu muslim farmlabor_cultivator education rural poli_interest young i.state if mod1 == 1


* Approve of Land Grabs:
eststo: logit supp_landgrab sy1985 i.anyreform7185 i.state if mod2 == 1
margins, dydx(sy1985) at(anyreform7185=(0)) atmeans
margins , dydx(anyreform7185) at(sy1985=(1)) atmeans

eststo: logit supp_landgrab sy1985 landref_71_85 i.state if mod2 == 1
margins, dydx(sy1985) at(landref_71_85=(0)) atmeans
margins , dydx(landref_71_85) at(sy1985=(1)) atmeans

eststo: logit supp_landgrab sy1985 anyreform7185 dalit backwards brahmin male hindu muslim farmlabor_cultivator education rural poli_interest young i.state if mod2 == 1
eststo: logit supp_landgrab sy1985 landref_71_85 dalit backwards brahmin male hindu muslim farmlabor_cultivator education rural poli_interest young i.state if mod2 == 1


esttab using table1.tex, replace se(2) star(* 0.10 ** 0.05 *** 0.01) sca("N Obs." "N_g States" "ll Log Lik." "chi2 $\chi^2$" "chi2_c Prob $ > \chi^2$" ) title(Individual Support for Land Reform, DiD) addn(Logit with standard errors in parentheses. Two-tail tests.) b(2) 



